package tk.winshu.provider;

import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import tk.winshu.api.DemoResponse;
import tk.winshu.api.IDemoService;

/**
 * @author Kevin
 * @since 2019/01/09.
 */
@Component
@Service(version = "1.0.0", interfaceClass = IDemoService.class)
public class DemoService implements IDemoService {

    public DemoResponse sayHello(String name) {
        if (name == null) {
            return new DemoResponse("default", "Hello Dubbo");
        }
        return new DemoResponse("custom", "Hello " + name);
    }
}
